<?php

use yii\db\Migration;
use yii\db\Schema;


class m180320_012044_ADD_FIELD_CUSTOMER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
         $this->addColumn('{{customer}}', 'passport_grant', Schema::TYPE_DATETIME. " null COMMENT '护照签发日期' AFTER remark");

         $this->addColumn('{{customer}}', 'card', Schema::TYPE_STRING. "(18) null COMMENT '身份证号码' AFTER passport_grant ");
         $this->addColumn('{{customer}}', 'card_address', Schema::TYPE_STRING. "(64) null COMMENT '身份证签发地' AFTER card ");
         $this->addColumn('{{customer}}', 'card_img', Schema::TYPE_STRING. "(255) null COMMENT '身份证或户口照片' AFTER card_address ");
         $this->addColumn('{{customer}}', 'nation', Schema::TYPE_STRING. "(32) null COMMENT '民族' AFTER card_img ");

         $this->addColumn('{{customer}}', 'group', Schema::TYPE_STRING. "(18) null COMMENT '团号' ");
         $this->addColumn('{{customer}}', 'supply', Schema::TYPE_STRING. "(18) null COMMENT '体系' ");
         $this->addColumn('{{customer}}', 'rank', Schema::TYPE_STRING. "(18) null COMMENT '职级' ");
         $this->addColumn('{{customer}}', 'trip', Schema::TYPE_STRING. "(18) null COMMENT '岸上游览路线' ");
         $this->addColumn('{{customer}}', 'size', Schema::TYPE_STRING. "(18) null COMMENT '皮肤衣尺寸' ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m180320_012044_ADD_FIELD_CUSTOMER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180320_012044_ADD_FIELD_CUSTOMER cannot be reverted.\n";

        return false;
    }
    */
}
